package cn.imnaer.service.rest.view.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import cn.imnaer.service.persistence.model.SharePhotoItem;

/**
 * 分享相片( 用于灵感--始于, 玩伴)
 * Created by Administrator on 2015/5/6.
 */
public class SharePhotoItemResponse implements Serializable {
    /**
     * 相片Item Id
     */
    private String sharePhotoItemId;
    /**
     * 相片名称(路径)
     */
    private String image;
    /**
     * 说明
     */
    private String introduction;
    /**
     * 是否支持(赞)
     */
    private boolean isSupport = false;
    /**
     * 赞数
     */
    private int supportCount = 0;
    /**
     * 赞的用户
     */
    private List<String> supportUsers;
    /**
     *
     */
    private int commentCount = 0;
    private List<SharePhotoCommentResponse> comments = new ArrayList<SharePhotoCommentResponse>();
    public SharePhotoItemResponse parse(SharePhotoItem target) {
        this.sharePhotoItemId = target.getSharePhotoItemId();
        this.image = target.getImage();
        this.introduction = target.getIntroduction();
        this.supportUsers = target.getSupportUsers();
        return this;
    }

    public static List<SharePhotoItemResponse> parseList(List<SharePhotoItem> targetList) {
        List<SharePhotoItemResponse> result = new ArrayList<>();
        for (SharePhotoItem target : targetList) {
            SharePhotoItemResponse temp = new SharePhotoItemResponse().parse(target);
            result.add(temp);
        }
        return result;
    }
    public String getSharePhotoItemId() {
        return sharePhotoItemId;
    }

    public void setSharePhotoItemId(String sharePhotoItemId) {
        this.sharePhotoItemId = sharePhotoItemId;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public boolean getIsSupport() {
        return isSupport;
    }

    public void setIsSupport(boolean isSupport) {
        this.isSupport = isSupport;
    }

    public int getSupportCount() {
        return supportCount;
    }

    public void setSupportCount(int supportCount) {
        this.supportCount = supportCount;
    }

    public List<String> getSupportUsers() {
        return supportUsers;
    }

    public void setSupportUsers(List<String> supportUsers) {
        this.supportUsers = supportUsers;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public List<SharePhotoCommentResponse> getComments() {
        return comments;
    }

    public void setComments(List<SharePhotoCommentResponse> comments) {
        this.comments = comments;
    }

    public void addComment(SharePhotoCommentResponse comment) {
        this.comments.add(comment);

    }
}
